<?php

namespace app\mini\controller\api\nav;

use app\mini\model\MiniNav;

class Search extends Base
{

    public function index()
    {
        $pos = $this->request->get('pos');
        if (!$pos) {
            return [];
        }
        $model = MiniNav::where('pos', $pos);
        $model->order('inx', 'DESC');
        $model->order('id', 'DESC');
        $model->field([
            'id', 'name', 'icon', 'selected_icon',
            'path', 'type'
        ]);
        $list = $model->find();
        return json_return($list);
    }

}